<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<title>Base64</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css"
title="Style">
<!-- created by Alessandro Beneventi, Universita' degli Studi di Parma -->
<!--            alessandro.beneventi@re.nettuno.it                     -->
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#0000FF"
vlink="#0000FF" alink="#0000FF">

<table border="0" cellspacing="0" width="100%">
    <tr>
        <td bgcolor="#EEEEFF" id="NavBarCell1"><a
        name="navbar_top_firstrow"></a> <table border="0"
        cellpadding="0" cellspacing="3">
            <tr>
                <td align="center" valign="top" bgcolor="#EEEEFF"
                id="NavBarCell1">Sections:</td>
                <td align="center" valign="top" bgcolor="#EEEEFF"
                id="NavBarCell1"><a href="index.html"><b>Index</b></a></td>
                <td align="center" valign="top" bgcolor="#FFFFFF"
                id="NavBarCell1Rev">&nbsp;<b>Introduction</b></td>
                <td align="center" valign="top" bgcolor="#EEEEFF"
                id="NavBarCell1"><b>More Info.</b></td>
                <td align="center" valign="top" bgcolor="#EEEEFF"
                id="NavBarCell1"><b>Visual Index</b></td>
                <td align="center" valign="top" bgcolor="#EEEEFF"
                id="NavBarCell1"><a href="../api/index.html"><b>Class
                by Class</b></a></td>
                <td align="center" valign="top" bgcolor="#EEEEFF"
                id="NavBarCell1"><a href="../links.htm"><b>Links</b></a></td>
            </tr>
        </table>
        </td>
        <td align="right" valign="top" rowspan="2">&nbsp;</td>
    </tr>
</table>

<p><font size="6" face="Arial"><b>Base64</b></font> </p>

<p>Author: Fabio Bellifemine (TILab S.p.a)<br>
Date: 6/01/2001</p>

<p> </p><span lang="EN-GB">

<p><font face="Arial,Helvetica">This examples shows how to transport serialized Java objects
inside an ACLMessage.<br>
It is also an example of how to register, deregister, and search agents and services with the DF.<br>
Finally, it also show how to force the platform to encode messages in bit-efficient ACLCodec or XML
ACLCodec.</font> </p>

<p><font face="Arial,Helvetica">You can launch the example with the following simple command:</font> </p>

<p><font face="Arial,Helvetica">java jade.Boot -platform writer:examples.Base64.ObjectWriterAgent&nbsp;
reader:examples.Base64.ObjectReaderAgent</font> </p>

<p><font face="Arial,Helvetica">or, much more interesting, with the following 2 commands:</font> </p>

<p><font face="Arial,Helvetica">java jade.Boot -port 1099 writer:examples.Base64.ObjectWriterAgent</font> </p>

<p><font face="Arial,Helvetica">java jade.Boot -port 1200 reader:examples.Base64.ObjectReaderAgent</font> 
</p>

<p><font face="Arial,Helvetica">in this case, you must also federated the DF of
the two platforms such that the ObjectWriterAgent's search is propagated to the
DF of the second platform also.</font></p>

<p><font face="Arial,Helvetica">The Person class it is here used&nbsp; just as a support class for the object reader and writer
agents.</font>&nbsp; <br>
&nbsp;</p>

<table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr>
        <td colspan="2" bgcolor="#CCCCFF"><font size="5"><b>ObjectReaderAgent</b></font></td>
    </tr>
    <tr>
        <td bgcolor="#FFFFFF"><strong>Description:</strong></td>
    </tr>
    <tr>
        <td><font face="Arial,Helvetica">This agent makes the
        following task:</font> <br>
        <font face="Arial,Helvetica">&nbsp;&nbsp;&nbsp; 1.
        registers itself with the df as a reader;</font> <br>
        <font face="Arial,Helvetica">&nbsp;&nbsp;&nbsp; 2. waits
        a message from its companion, the ObjectWriterAgent;</font>
        <br>
        <font face="Arial,Helvetica">&nbsp;&nbsp;&nbsp; 3. reads
        the content of the message. If the language was set to &quot;JavaSerialization&quot;
        it assumes, by a-priori knowledge, that the content&nbsp;
        it is encoded in Base64 and contains a Java object.</font>
        <br>
        </td>
    </tr>
    <tr>
        <td><strong>Jade classes used: </strong></td>
    </tr>
    <tr>
        <td>SimpleBehaviour,DFAgentDesciption,ServiveDescription,DFServiceCommunicator</td>
    </tr>
    <tr>
        <td><strong>Source</strong></td>
    </tr>
    <tr>
        <td>\src\examples\Base64\ObjectReaderAgent.java</td>
    </tr>
</table>

<p>&nbsp; </p>

<table border="1" cellpadding="3" cellspacing="0" width="100%">
    <tr>
        <td colspan="2" bgcolor="#CCCCFF"><font size="5"><b>ObjectWriterAgent</b></font></td>
    </tr>
    <tr>
        <td bgcolor="#FFFFFF"><strong>Description:</strong></td>
    </tr>
    <tr>
        <td><font face="Arial,Helvetica">This agent makes the
        following task:</font> <br>
        <font face="Arial,Helvetica">&nbsp;&nbsp;&nbsp; 1.
        searches in the DF for an ObjectReaderAgent;</font> <br>
        <font face="Arial,Helvetica">&nbsp;&nbsp;&nbsp; 2. sends
        an ACLMessage with a content encoded in Base64 to
        the&nbsp; ObjectReaderAgent.</font> <font
        face="Arial,Helvetica">&nbsp;</font> <br>
      <font face="Arial,Helvetica">&nbsp;&nbsp;&nbsp; 3. sends the same message 
      by using the BitEfficient ACLCodec (notice that the message is actually 
      coded only if the receiver belongs to another platform) first, and the XML 
      ACLCodec then<br>
        &nbsp;&nbsp;&nbsp; 4. sends an ACLMessage with a content encoded as a String<br>
        &nbsp;&nbsp;&nbsp; 5. sends the same message by using again BitfficientACLCodec and XMLACLCodec</font> <font>&nbsp;

          </font>

        </td>
    </tr>
    <tr>
        <td><strong>Jade classes used: </strong></td>
    </tr>
    <tr>
        <td>ACLMessage,DFAgentDesciption,ServiveDescription,DFServiceCommunicator</td>
    </tr>
    <tr>
        <td><strong>Source</strong></td>
    </tr>
    <tr>
        <td>\src\examples\Base64\ObjectWriterAgent.java</td>
    </tr>
</table>

</span><p><span lang="EN-GB"></span> &nbsp;</p>

<hr>

<p align="left"><a href="http://jade.cselt.it/"><font size="2"
face="Arial">JADE</font></a><font size="2" face="Arial"> is a
trademark of <a href="http://www.telecomitalialab.com">TILAB</a> (formerly </font><a href="http://www.cselt.it"><font size="2"
face="Arial">CSELT</font></a><font size="2" face="Arial">).&nbsp;</font><a
href="http://jade.cselt.it/"><font size="2" face="Arial"><br>
JADE</font></a><font
size="2" face="Arial"> has been developed jointly by <a href="http://www.telecomitalialab.com">TILAB</a>
(formerly </font><a href="http://www.cselt.it"><font size="2"
face="Arial">CSELT</font></a><font size="2" face="Arial">) and the </font><a
href="http://www.ce.unipr.it"><font size="2" face="Arial">Computer
Engineering Group</font></a><font size="2" face="Arial"> of the </font><a
href="http://www.unipr.it"><font size="2" face="Arial">University
of Parma</font></a> </p>

</body>
</html>
